{layout name="layout" /}
<div id="actionbar" class="fn-clear">
    <a href="{:url('fastshop/sale/add')}" class="button button-blue"><i class="iconfont icon-add_icon"></i>增加</a>
</div>
<table class="table">
    <thead>
        <tr>
            <th class="fn-tac w60">排序</th>
            <th>商品名称</th>
            <th class="fn-tac w180">活动类型</th>
            <th class="fn-tac w200">活动时间</th>
            <th class="w60">库存</th>
            <th class="w100 fn-tar">成本价</th>
            <th class="w100 fn-tar">销售价</th>
            <th class="w100 fn-tar">市场价</th>
            <th class="fn-tac w90">操作</th>
        </tr>
    </thead>
    <tbody>
        {foreach $lists as $vo}
        <tr>
            <td class="fn-tac"><input name="sort" class="fn-tac w40 input input-mini" type="text" value="{$vo['sort']}" id="{$vo.id}" /></td>
            <td>
                {if $vo.types}<span class="badge bg-green m5">上线</span>{else}<span class="badge">下线</span>{/if}
               
                <a href="{:url('fastshop/sale/edit',array('id'=>$vo.id))}">{$vo.title}</a>
            </td>
            <td class="fn-tac">
                {if $vo.is_vip}<span class="badge bg-blue m5">会员</span>{else}<span class="badge m5">普通</span>{/if}
                {if $vo.is_newuser}<span class="badge bg-green m5">限新</span>{else}<span class="badge m5">限旧</span>{/if}
                {if $vo.is_fusion}<span class="badge bg-red m5">聚变</span>{else}<span class="badge">裂变</span>{/if}
            </td>
            <td class="fn-tac">{$vo.start_time|date='m-d H:i'} 至 {$vo.end_time|date='m-d H:i'} </td>
            <td>{$vo.sale_nums}</td>
            <td class="fn-tar">￥{$vo.cost_price/100|money}</td>
            <td class="fn-tar">￥{$vo.sale_price/100|money}</td>
            <td class="fn-tar">￥{$vo.market_price/100|money}</td>
            <td class="fn-tac">
                <a class="button isDel" url="{:url('fastshop/sale/delete',['id'=>$vo.id])}" href="javascript:;" title="删除"><i class="iconfont icon-lajixiang"></i>删除</a>
            </td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
    Do('base', 'layer', 'tip', 'ztree', function () {
        $('.isDel').isDel();
        sort("{:url('fastshop/sale/sort')}");
        $(".bar").click(function () {
            var url = $(this).attr('url');
            var issale = $(this).attr('issale');
            if (typeof (url) == 'undefined') {
                url = '{:url("fastshop/item/ids_action")}?issale=' + issale;
            }
            var msg = $(this).attr('msg');
            tools_submit({ action: url, msg: msg })
        })
    })
</script>